package demo09_BlockingQueue;

import java.util.concurrent.ArrayBlockingQueue;

/**
 * @author kunkun
 * @className Test03_Blocking
 * @Description 阻塞，一直等待
 * @date 2025/3/6 13:54
 */
public class Test03_Blocking {

    public static void main(String[] args) throws InterruptedException {
        ArrayBlockingQueue<Object> queue = new ArrayBlockingQueue<>(2);

        //1. 新增
        queue.put("a");
        queue.put("b");
        //queue.put("c"); //队列已满，持续等待

        //2. 移除
        queue.take();
        queue.take();
        queue.take();    //队空，持续等待


    }




}
